Hi there, I'm working with the built in Recursive Traceability script to show 2 levels of links. So, we have Module A, showing outlinks to Module B in column 1, and then the recursive links from Module B to Module C in Column 2. Here is an example of how the links work: |
Re: How to show a linked object only once Where you finally display info of object in C, instead put the "Object" handle into a global skip list. After parsing all the links then loop through the Skip displaying info of each object therein.
Skip skpObjects = createString() // KEY 'string' ObjID; DATA: 'Object' handle in C
void DisplayInfo()
{ for o in skpObjects do
{ "Display" info about o
}
}
void Whatever(int depth)
{ for links from A to C
{ bla bla bla
find othero object in C
// comment out the "s" and "display" lines
put(skpObjects, identifier(othero), othero)
}
}
Whatever(2)
DisplayInfo()
delete(skpObjects)
|
Re: How to show a linked object only once llandale - Wed Nov 14 13:37:32 EST 2012 Where you finally display info of object in C, instead put the "Object" handle into a global skip list. After parsing all the links then loop through the Skip displaying info of each object therein.
Skip skpObjects = createString() // KEY 'string' ObjID; DATA: 'Object' handle in C
void DisplayInfo()
{ for o in skpObjects do
{ "Display" info about o
}
}
void Whatever(int depth)
{ for links from A to C
{ bla bla bla
find othero object in C
// comment out the "s" and "display" lines
put(skpObjects, identifier(othero), othero)
}
}
Whatever(2)
DisplayInfo()
delete(skpObjects)
Hi Louie,
// DXL generated by DOORS traceability wizard on 31 October 2012.
// Wizard version 2.0, DOORS version 9.2.0.4
pragma runLim, 0
string limitModules[2] = {"471615b43d9013d6-000018e1", "471615b43d9013d6-00001ea2"}
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showOut(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
othero = target l
if (null othero) {
load(otherVersion,false)
}
othero = target l
if (null othero) continue
if (isDeleted othero) continue
adjustLines(depth, 2)
if (depth < 2) {
showOut(othero, depth+1)
}
doneOne = true
if (depth == 2) {
disp = ""
s = probeRichAttr_(othero,"Absolute Number", true)
disp = disp s
s = probeRichAttr_(othero,"Object Heading", true)
disp = disp " " s
displayRich("\\pard " disp)
}
lines[depth-1]++
}
}
showOut(obj,1)
|
Re: How to show a linked object only once Mike_the_SE - Wed Nov 14 13:51:18 EST 2012
Hi Louie,
// DXL generated by DOORS traceability wizard on 31 October 2012.
// Wizard version 2.0, DOORS version 9.2.0.4
pragma runLim, 0
string limitModules[2] = {"471615b43d9013d6-000018e1", "471615b43d9013d6-00001ea2"}
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showOut(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for l in all(o->linkModName) do {
otherVersion = targetVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
othero = target l
if (null othero) {
load(otherVersion,false)
}
othero = target l
if (null othero) continue
if (isDeleted othero) continue
adjustLines(depth, 2)
if (depth < 2) {
showOut(othero, depth+1)
}
doneOne = true
if (depth == 2) {
disp = ""
s = probeRichAttr_(othero,"Absolute Number", true)
disp = disp s
s = probeRichAttr_(othero,"Object Heading", true)
disp = disp " " s
displayRich("\\pard " disp)
}
lines[depth-1]++
}
}
showOut(obj,1)
-Louie |